package com.catmiao.spark.test

import java.io.ObjectInputStream
import java.net.ServerSocket

/**
 * @title: Driver
 * @projectName spark_study
 * @description: TODO
 * @author ChengMiao
 * @date 2024/1/11 14:41
 */
object Executor {


  def main(args: Array[String]): Unit = {
    val server = new ServerSocket(9999)

    println("服务器启动:9999....")

    val client = server.accept()
    val in = client.getInputStream

    val stream = new ObjectInputStream(in)

    val task = stream.readObject().asInstanceOf[SubTask]


    println("接收到客户端:" + task)

    val result = task.comp()
    println("执行结果:" + result)


    in.close()
    server.close()
  }
}
